<template>
  <div class="descriptions" v-if="show">
    <div class="label" :style="{ width: labelWidth }">{{ label }}<span v-if="separate">：</span></div>
    <div class="value" :class="{ light: light }" @click="onclick">{{ value }}<slot name="value"></slot></div>
  </div>
</template>

<script setup>
const props = defineProps({
  label: {
    type: String,
    default: "",
  },
  value: {
    type: [String, Number],
    default: "",
  },
  labelWidth: {
    type: [String, Number],
    default: "98px",
  },
  light: {
    type: Boolean,
    default: false,
  },
  separate: {
    type: Boolean,
    default: true,
  },
  show: {
    type: Boolean,
    default: true,
  },
  onclick: {
    type: Function,
    default: () => {},
  },
})
</script>

<style lang="scss" scoped>
.descriptions {
  display: flex;
  font-size: 14px;
  font-weight: 400;
  align-items: center;
  margin: 12px 0;
  .label {
    text-align: right;
    font-size: 14px;
    font-weight: 400;
    // color: #9da1ad;

    color: var(--base-sub-text-color);
    line-height: 20px;
  }
  .value {
    // color: #333;
    color: var(--base-text-color);
    line-height: 20px;
    min-width: 200px;
    margin-right: 2px;
    &.light {
      color: #ff0000;
    }
  }
}
</style>
